#include "Baseconst.h"
#include "Zlist.h"
#pragma once

int CalData(int x,int y,bool pass);
TPos CalXY(int data);
bool GridPass(int data);
int ChackLoadGridIn(TZList *loadlist,PGrid pgrid);

class CObstruct
{
public:
	CObstruct();
	~CObstruct();
	void CreateObs(int w,int h);
	void DeleteObs();
	void SetGrids(int i,int j,int x,int y,bool pass);
	void GetLoad(TZList *loadlist,PGrid start,PGrid target);
	PGrid GetNear(PGrid target,PGrid start);
	PGrid GetGridForPos(TPos pos);
	void SetWH(int w,int h);
	int W,H;
	int rateW,rateH;
	PGrid **m_Grids;
	TZList *pCloseList;
};